home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: hobbit.ireq.hydro.qc.ca!news
- From: Ryszard Pater <pater@ireq.ca>
- Subject: Square of a floating point number.
- X-Nntp-Posting-Host: paspebiac.ireq.ca
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <Dpo0Mn.DEo@ireq.hydro.qc.ca>
- Sender: news@ireq.hydro.qc.ca (Netnews Admin)
- Content-Transfer-Encoding: 7bit
- Organization: IREQ
- Mime-Version: 1.0
- Date: Wed, 10 Apr 1996 21:20:47 GMT
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- How could I optimize for a speed the function to compute the square
- of a floating point number? I defined a function as follows:
- inline float sqr(float a) {return a*a;}
- or macro version
- #define sqr(a) ((a)*(a)).
- If You have a better solution give me a feed back, please.
-
- Ryszard
- pater@ireq.ca
-
-